/*
 * @Author: zhangdong 354266323@qq.com
 * @Date: 2022-06-07 16:56:52
 * @LastEditors: zhangdong 354266323@qq.com
 * @LastEditTime: 2022-07-25 12:39:57
 * @FilePath: \logistics-sunshine-unattended-app\common\http.interceptor.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// #ifdef VUE3
let jsonObj = plus.runtime.arguments
let a = JSON.parse(jsonObj)
let b = JSON.stringify(a)
let c = JSON.parse(b)
let { token, wasSubscribed } = c
// #endif

// common/http.interceptor.js
let install = (Vue, vm) => {
  // 此为自定义配置参数，具体参数见上方说明
  Vue.prototype.$u.http.setConfig({
    // 开发
    // baseUrl: 'http://192.168.2.218/dev/api',
    // 测试
    // baseUrl: 'http://www.sxjbjt.com:9538/lyg-server/dev/api',
    // 正式
    baseUrl: 'https://freight.wskjwl.com/freight-prod/api',
    loadingText: '努力加载中~',
    loadingTime: 800,
    // 设置自定义头部content- type
    header: {
      'content-type': 'application/json',
      // 'userAccount': userAccount,
      // #ifdef VUE3
      Authentication: token,
      Authorization: 'Basic YW5kcm9pZDphbmRyb2lk',
      // 'Authentication': token,
      'user-agent':
        'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1',

      // #endif
      // 'Appuuid': '111',
      // #ifndef VUE3
      Authorization: 'Basic YW5kcm9pZDphbmRyb2lk',
      // #endif
    },
  })
}
// console.log("UUID: "+plus.device.uuid);

export default {
  install,
}
